<template>
	<view class="consulting" >
		<view class="consulting-herader">
			<view class="consulting-herader-title">资讯</view>
			<view class="consulting-herader-text" @click="zxToPage">购车信息全面掌握 <u-icon name="arrow-right" size="22" color="#fff"></u-icon></view>
		</view>
		<view class="consulting-content">
			<block v-for="(item,index) in zxList" :key="index">
				<navigator :url="'/pagesB/news/newsDetail?articleId='+item.articleId">
				<!-- <navigator @click="isShowtoast"> -->
					<view class="consulting-content-list">
						<view class="consulting-content-item" v-if="index <= 2">
							<view class="consulting-content-item-left">
								<image v-if="index == 0" src="../../static/index/top.png" mode="scaleToFill"></image>
								<text v-else>{{ index }}</text>
							</view>
							<view class="consulting-content-item-cont">{{ item.articleTitle }}</view>
							<!-- <view class="consulting-content-item-cont">{{ item }}</view> -->
							<view class="consulting-content-item-right">
								<image v-if="index == 0" src="../../static/index/zx_1.png" mode="scaleToFill"></image>
								<image v-if="index == 1" src="../../static/index/zx_2.png" mode="scaleToFill"></image>
								<image v-if="index == 2" src="../../static/index/zx_3.png" mode="scaleToFill"></image>
							</view>
						</view>
					</view>
				</navigator>
			</block>
		</view>
	</view>
</template>

<script>
	export default {
		name:"consulting",
		props:{
			zxList:{
				type: Array,
				default(){
					return []
				}
			}
		},
		data() {
			return {
				//写死的数据
				// zxList:[
				// 	'中国智能电动二手车产业联盟成立',
				// 	'中国智能电动二手车Q4保值率指数发布',
				// 	'中国汽研&EV100联合发布智能电动二手车评估指南'
				// ]
			};
		},
		methods:{
			zxToPage(){
				uni.navigateTo({
					url: '/pagesB/news/newsList'
				})
				// uni.showToast({
				// 	title:'功能正在开发中,敬请期待',
				// 	icon:'none'
				// })
			},
			//功能正在开发
			isShowtoast(){
				uni.showToast({
					title:'功能正在开发中,敬请期待',
					icon:'none'
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.consulting{
		background-color: $uni-bg-color;
		margin: $uni-widthspace $uni-widthspace 0rpx;
		border-radius: 10rpx;
		.consulting-herader{
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: $uni-widthspace;
			box-sizing: border-box;
			// border-bottom: 1px solid #e6e6e6;
			.consulting-herader-title{
				font-size: 36rpx;
				font-weight: bolder;
				color: #333;
			}
			.consulting-herader-text{
				font-size: 24rpx;
				height: 40rpx;
				line-height: 40rpx;
				display: flex;
				align-items: center;
				background-color: #0e2a53;
				border-radius: 40rpx;
				color: #fff;
				padding: 2rpx 10rpx;
			}
		}
		.consulting-content{
			display: flex;
			flex-direction: column;
			padding: 0rpx $uni-widthspace 20rpx;
			box-sizing: border-box;
			.consulting-content-item{
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin-top: 20rpx;
				.consulting-content-item-left{
					margin-right: 20rpx;
					image{
						width: 24rpx;
						height: 36rpx;
					}
					text{
						width: 24rpx;
						display: inline-block;
						font-size: 28rpx;
						color: #F98151;
					
					}
				}
				.consulting-content-item-cont{
					flex: 1;
					font-size: 28rpx;
					color: #333;
					overflow:hidden; //超出的文本隐藏
					text-overflow:ellipsis; //溢出用省略号显示
					white-space:nowrap; //溢出不换行
				}
				.consulting-content-item-right{
					margin-left: 20rpx;
					image{
						width: 40rpx;
						height: 40rpx;
					}
				}
			}
		}
	}
</style>
